{
	arguments: {
		idGallery: '<?=$_POST['idGallery']?>',
		title: '<?=$_POST['title']?>',
		slug: '<?=$_POST['slug']?>',
		description: '<?=str_replace("\n", "\\n", $_POST['description'])?>',
	},
<?php
if (!$_POST['login'] and !$_POST['description']) {
?>
	type: 'error',
	error: '<?php echo Site::lang("The title or the description must have something!"); ?>'
<?php
} else {
	$gallery = new Gallery($_POST['idGallery']);
	$gallery->title = utf8_decode($_POST['title']);
	$gallery->slug = utf8_decode($_POST['slug']);
	$gallery->description = utf8_decode($_POST['description']);
	$result = $gallery->save();
	if ($result) {
?>
	type: 'success',
	entry: {
		idGallery: '<?php echo $gallery->get_id(); ?>',
		title: '<?php echo $gallery->get_title(); ?>',
		description: '<?php echo $gallery->get_content(); ?>',
		slug: '<?php echo $gallery->slug; ?>',
		creationDate: '<?php echo $gallery->creationDate; ?>',
		idParent: '<?php echo $gallery->id_parent; ?>',
		type: '<?php echo $gallery->type; ?>'
	}
<?php	
	} else {
?>
	type: 'error',
	error: '<?php echo $gallery->_errmsg; ?>'
<?php
	}
}
?>
}
<?php
exit;
?>